﻿namespace Northwind.Silverlight.Caliburn.Products {
    using System.ComponentModel.Composition;
    using Framework;

    using Northwind.BusinessObjects;

    [Export(typeof(ProductViewModel)), PartCreationPolicy(CreationPolicy.NonShared)]
    
    public class ProductViewModel : DocumentBase {

        private ProductInfo _Model;
        public ProductViewModel(ProductInfo product)
        {
            _Model = product;
        }

        public void Save() {
            IsDirty = false;
            Dialogs.ShowMessageBox("Your data has been successfully saved.", "Data Saved");
        }

        public int ProductId 
        { 
            get
            {
                return _Model.ProductId;
            }
            set { }
        }

        public string ProductName {
            get { return _Model.ProductName; } 
            set {} 
        }
    }
}